<template>
    
        <tr>
        <td>
            <input v-model="goods.checked" type="checkbox" />
          </td>
          <td>{{goods.name}}</td>
          <td>{{goods.price}}</td>
          <td> <button @click="goods.num>0 && goods.num--">-</button> <span>{{goods.num}}</span> <button @click="goods.num++">+</button></td>
          <td>{{allPrice}}</td>
          <td> <button @click="del">删除</button> </td>
         
    </tr>
</template>

<script>
export default {
   props:['goods'],

    data() {
        return {
            
        };
    },

    computed:{
        allPrice(){
            return this.goods.num * this.goods.price
        }
    },

    methods: {
        del(){  
            this.$emit('delgoods')
        }
    },
};
</script>

<style lang="css" scoped>

</style>